<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="renderer" content="webkit">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>后台管理系统</title>

    <base href="<?php echo base_url() . 'application/views/'; ?>"/>
    <!-- Bootstrap -->
    <?php if (isset($debug_page)): ?>
        <link href="../../../assets/bootstrap_ace/css/bootstrap.css" rel="stylesheet">
    <?php endif; ?>
    <link href="<?php echo full_static_url('bootstrap_ace/css/bootstrap.css'); ?>" rel="stylesheet">
    <link href="<?php echo full_static_url('bootstrap_ace/css/ace.css'); ?>" rel="stylesheet">
    <link href="<?php echo full_static_url('bootstrap_ace/css/font-awesome.css'); ?>" rel="stylesheet">
    <link href="<?php echo full_static_url('bootstrap_ace/css/ace-fonts.css'); ?>" rel="stylesheet">
    <link href="css/main.css" rel="stylesheet">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// --><!--[if lt IE 9]>
    <script src="js/html5shiv-3.7.2.min.js"></script>
    <script src="js/respond-1.4.2.min.js"></script><![endif]-->

</head>
<body class="no-skin">
<div id="navbar" class="navbar navbar-default navbar-fixed-top" role="navigation" style="border-bottom:1px solid #bbb">
    <div class="navbar-container" style="padding-left:0px;padding-right: 0px;" id="navbar-container">
        <!-- #section:basics/sidebar.mobile.toggle -->
        <button type="button" class="navbar-toggle menu-toggler pull-left" id="menu-toggler" data-target="#sidebar">
            <span class="sr-only">Toggle sidebar</span>

            <span class="icon-bar"></span>

            <span class="icon-bar"></span>

            <span class="icon-bar"></span>

        </button>
    </div><!-- /.navbar-container -->
    <div class="navbar-header pull-left">
        <a href="javascript:;" style=" color:#06C; padding-top:15px;text-shadow:1px 1px 1px rgba(0,0,0,1.5); font-family:'Times New Roman';"><span><img width="189" height="45" src="../views/images/logo3.png"/></span></a>
    </div>

    <div class="navbar-buttons navbar-header pull-right">
        <ul class="nav ace-nav">
            <?php
            $helper_id = isset($_SESSION['user_id']) ? intval($_SESSION['user_id']) : 0;
            if ($helper_id > 0): ?>
                <li class="light-blue">
                    <a data-toggle="dropdown" href="#" class="dropdown-toggle">
                        <img class="nav-user-photo" src="<?php echo get_image_oss($this->session->userdata('avatar')); ?>" onerror="this.src='<?php echo full_static_url('res/no_picture.png'); ?>'" alt="Jason's Photo"/>
                        <span class="user-info">
						<small>欢迎,</small><?php echo $_SESSION['real_name']; ?></span>
                        <i class="ace-icon fa fa-caret-down"></i> </a>
                    <ul class="user-menu dropdown-menu-right dropdown-menu dropdown-yellow dropdown-caret dropdown-close" style="width: 120px;">
                        <li>
                            <a data-toggle="ajaxModal" data-dailogclass="modal-lg" href="<?php echo site_url('permission/manager/ajax/edit/' . $helper_id) ?>"><i class="ace-icon fa fa-cog"></i> 个人信息
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a href="<?php echo site_url('privilege/logout'); ?>">
                                <i class="ace-icon fa fa-power-off"></i> 退出 </a>
                        </li>
                    </ul>
                </li>
            <?php endif; ?>
        </ul>
    </div>
</div>


<script language="JavaScript">
    onload = function () {
        window.setInterval(showtime, 1000);
    }
    function showtime() {
        $("#formt_datetime").html((new Date()).format("y-m-d h:i:s"));
        var timestamp = (new Date()).valueOf();//new Date().getTime()
        timestamp = Math.floor(timestamp / 1000);
        $("#timestamp").html(timestamp);
    }
    Date.prototype.format = function (partten) {
        if (partten == null || partten == '') {
            partten = 'y-m-d h:i:s';
        }
        var y = this.getFullYear();
        var m = this.getMonth() + 1;
        var d = this.getDate();
        var h = this.getHours();       //获取当前小时数(0-23)
        var i = this.getMinutes();     //获取当前分钟数(0-59)
        var s = this.getSeconds();     //获取当前秒数(0-59)

        var r = partten.replace(/y+/gi, y);
        r = r.replace(/m+/gi, (m < 10 ? "0" : "") + m);
        r = r.replace(/d+/gi, (d < 10 ? "0" : "") + d);
        r = r.replace(/h+/gi, (h < 10 ? "0" : "") + h);
        r = r.replace(/i+/gi, (i < 10 ? "0" : "") + i);
        r = r.replace(/s+/gi, (s < 10 ? "0" : "") + s);
        return r;
    }
</script>